Optimal. Leaf size=196 \[ \frac {5}{128} a^2 (9 A+2 B) x-\frac {a^2 (9 A+2 B) \cos ^7(c+d x)}{56 d}+\frac {5 a^2 (9 A+2 B) \cos (c+d x) \sin (c+d x)}{128 d}+\frac {5 a^2 (9 A+2 B) \cos ^3(c+d x) \sin (c+d x)}{192 d}+\frac {a^2 (9 A+2 B) \cos ^5(c+d x) \sin (c+d x)}{48 d}-\frac {B \cos ^7(c+d x) (a+a \sin (c+d x))^2}{9 d}-\frac {(9 A+2 B) \cos ^7(c+d x) \left (a^2+a^2 \sin (c+d x)\right )}{72 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.14, antiderivative size = 196, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 5, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.161, Rules used = {2939, 2757,
2748, 2715, 8} \begin {gather*} -\frac {a^2 (9 A+2 B) \cos ^7(c+d x)}{56 d}-\frac {(9 A+2 B) \cos ^7(c+d x) \left (a^2 \sin (c+d x)+a^2\right )}{72 d}+\frac {a^2 (9 A+2 B) \sin (c+d x) \cos ^5(c+d x)}{48 d}+\frac {5 a^2 (9 A+2 B) \sin (c+d x) \cos ^3(c+d x)}{192 d}+\frac {5 a^2 (9 A+2 B) \sin (c+d x) \cos (c+d x)}{128 d}+\frac {5}{128} a^2 x (9 A+2 B)-\frac {B \cos ^7(c+d x) (a \sin (c+d x)+a)^2}{9 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2715
Rule 2748
Rule 2757
Rule 2939
Rubi steps
\begin {align*} \int \cos ^6(c+d x) (a+a \sin (c+d x))^2 (A+B \sin (c+d x)) \, dx &=-\frac {B \cos ^7(c+d x) (a+a \sin (c+d x))^2}{9 d}+\frac {1}{9} (9 A+2 B) \int \cos ^6(c+d x) (a+a \sin (c+d x))^2 \, dx\\ &=-\frac {B \cos ^7(c+d x) (a+a \sin (c+d x))^2}{9 d}-\frac {(9 A+2 B) \cos ^7(c+d x) \left (a^2+a^2 \sin (c+d x)\right )}{72 d}+\frac {1}{8} (a (9 A+2 B)) \int \cos ^6(c+d x) (a+a \sin (c+d x)) \, dx\\ &=-\frac {a^2 (9 A+2 B) \cos ^7(c+d x)}{56 d}-\frac {B \cos ^7(c+d x) (a+a \sin (c+d x))^2}{9 d}-\frac {(9 A+2 B) \cos ^7(c+d x) \left (a^2+a^2 \sin (c+d x)\right )}{72 d}+\frac {1}{8} \left (a^2 (9 A+2 B)\right ) \int \cos ^6(c+d x) \, dx\\ &=-\frac {a^2 (9 A+2 B) \cos ^7(c+d x)}{56 d}+\frac {a^2 (9 A+2 B) \cos ^5(c+d x) \sin (c+d x)}{48 d}-\frac {B \cos ^7(c+d x) (a+a \sin (c+d x))^2}{9 d}-\frac {(9 A+2 B) \cos ^7(c+d x) \left (a^2+a^2 \sin (c+d x)\right )}{72 d}+\frac {1}{48} \left (5 a^2 (9 A+2 B)\right ) \int \cos ^4(c+d x) \, dx\\ &=-\frac {a^2 (9 A+2 B) \cos ^7(c+d x)}{56 d}+\frac {5 a^2 (9 A+2 B) \cos ^3(c+d x) \sin (c+d x)}{192 d}+\frac {a^2 (9 A+2 B) \cos ^5(c+d x) \sin (c+d x)}{48 d}-\frac {B \cos ^7(c+d x) (a+a \sin (c+d x))^2}{9 d}-\frac {(9 A+2 B) \cos ^7(c+d x) \left (a^2+a^2 \sin (c+d x)\right )}{72 d}+\frac {1}{64} \left (5 a^2 (9 A+2 B)\right ) \int \cos ^2(c+d x) \, dx\\ &=-\frac {a^2 (9 A+2 B) \cos ^7(c+d x)}{56 d}+\frac {5 a^2 (9 A+2 B) \cos (c+d x) \sin (c+d x)}{128 d}+\frac {5 a^2 (9 A+2 B) \cos ^3(c+d x) \sin (c+d x)}{192 d}+\frac {a^2 (9 A+2 B) \cos ^5(c+d x) \sin (c+d x)}{48 d}-\frac {B \cos ^7(c+d x) (a+a \sin (c+d x))^2}{9 d}-\frac {(9 A+2 B) \cos ^7(c+d x) \left (a^2+a^2 \sin (c+d x)\right )}{72 d}+\frac {1}{128} \left (5 a^2 (9 A+2 B)\right ) \int 1 \, dx\\ &=\frac {5}{128} a^2 (9 A+2 B) x-\frac {a^2 (9 A+2 B) \cos ^7(c+d x)}{56 d}+\frac {5 a^2 (9 A+2 B) \cos (c+d x) \sin (c+d x)}{128 d}+\frac {5 a^2 (9 A+2 B) \cos ^3(c+d x) \sin (c+d x)}{192 d}+\frac {a^2 (9 A+2 B) \cos ^5(c+d x) \sin (c+d x)}{48 d}-\frac {B \cos ^7(c+d x) (a+a \sin (c+d x))^2}{9 d}-\frac {(9 A+2 B) \cos ^7(c+d x) \left (a^2+a^2 \sin (c+d x)\right )}{72 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 3.69, size = 216, normalized size = 1.10 \begin {gather*} -\frac {a^2 \cos (c+d x) \left (2880 A+1900 B+\frac {2520 (9 A+2 B) \sin ^{-1}\left (\frac {\sqrt {1-\sin (c+d x)}}{\sqrt {2}}\right )}{\sqrt {\cos ^2(c+d x)}}+32 (135 A+86 B) \cos (2 (c+d x))+16 (108 A+59 B) \cos (4 (c+d x))+288 A \cos (6 (c+d x))+64 B \cos (6 (c+d x))-28 B \cos (8 (c+d x))-13671 A \sin (c+d x)-2478 B \sin (c+d x)-2457 A \sin (3 (c+d x))+462 B \sin (3 (c+d x))-63 A \sin (5 (c+d x))+546 B \sin (5 (c+d x))+63 A \sin (7 (c+d x))+126 B \sin (7 (c+d x))\right )}{32256 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.58, size = 245, normalized size = 1.25 Too large to display
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.39, size = 208, normalized size = 1.06 \begin {gather*} -\frac {18432 \, A a^{2} \cos \left (d x + c\right )^{7} + 9216 \, B a^{2} \cos \left (d x + c\right )^{7} - 21 \, {\left (64 \, \sin \left (2 \, d x + 2 \, c\right )^{3} + 120 \, d x + 120 \, c - 3 \, \sin \left (8 \, d x + 8 \, c\right ) - 24 \, \sin \left (4 \, d x + 4 \, c\right )\right )} A a^{2} + 336 \, {\left (4 \, \sin \left (2 \, d x + 2 \, c\right )^{3} - 60 \, d x - 60 \, c - 9 \, \sin \left (4 \, d x + 4 \, c\right ) - 48 \, \sin \left (2 \, d x + 2 \, c\right )\right )} A a^{2} - 1024 \, {\left (7 \, \cos \left (d x + c\right )^{9} - 9 \, \cos \left (d x + c\right )^{7}\right )} B a^{2} - 42 \, {\left (64 \, \sin \left (2 \, d x + 2 \, c\right )^{3} + 120 \, d x + 120 \, c - 3 \, \sin \left (8 \, d x + 8 \, c\right ) - 24 \, \sin \left (4 \, d x + 4 \, c\right )\right )} B a^{2}}{64512 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.38, size = 135, normalized size = 0.69 \begin {gather*} \frac {896 \, B a^{2} \cos \left (d x + c\right )^{9} - 2304 \, {\left (A + B\right )} a^{2} \cos \left (d x + c\right )^{7} + 315 \, {\left (9 \, A + 2 \, B\right )} a^{2} d x - 21 \, {\left (48 \, {\left (A + 2 \, B\right )} a^{2} \cos \left (d x + c\right )^{7} - 8 \, {\left (9 \, A + 2 \, B\right )} a^{2} \cos \left (d x + c\right )^{5} - 10 \, {\left (9 \, A + 2 \, B\right )} a^{2} \cos \left (d x + c\right )^{3} - 15 \, {\left (9 \, A + 2 \, B\right )} a^{2} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{8064 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 719 vs.
\(2 (180) = 360\).
time = 1.42, size = 719, normalized size = 3.67 \begin {gather*} \begin {cases} \frac {5 A a^{2} x \sin ^{8}{\left (c + d x \right )}}{128} + \frac {5 A a^{2} x \sin ^{6}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{32} + \frac {5 A a^{2} x \sin ^{6}{\left (c + d x \right )}}{16} + \frac {15 A a^{2} x \sin ^{4}{\left (c + d x \right )} \cos ^{4}{\left (c + d x \right )}}{64} + \frac {15 A a^{2} x \sin ^{4}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{16} + \frac {5 A a^{2} x \sin ^{2}{\left (c + d x \right )} \cos ^{6}{\left (c + d x \right )}}{32} + \frac {15 A a^{2} x \sin ^{2}{\left (c + d x \right )} \cos ^{4}{\left (c + d x \right )}}{16} + \frac {5 A a^{2} x \cos ^{8}{\left (c + d x \right )}}{128} + \frac {5 A a^{2} x \cos ^{6}{\left (c + d x \right )}}{16} + \frac {5 A a^{2} \sin ^{7}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{128 d} + \frac {55 A a^{2} \sin ^{5}{\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{384 d} + \frac {5 A a^{2} \sin ^{5}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{16 d} + \frac {73 A a^{2} \sin ^{3}{\left (c + d x \right )} \cos ^{5}{\left (c + d x \right )}}{384 d} + \frac {5 A a^{2} \sin ^{3}{\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{6 d} - \frac {5 A a^{2} \sin {\left (c + d x \right )} \cos ^{7}{\left (c + d x \right )}}{128 d} + \frac {11 A a^{2} \sin {\left (c + d x \right )} \cos ^{5}{\left (c + d x \right )}}{16 d} - \frac {2 A a^{2} \cos ^{7}{\left (c + d x \right )}}{7 d} + \frac {5 B a^{2} x \sin ^{8}{\left (c + d x \right )}}{64} + \frac {5 B a^{2} x \sin ^{6}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{16} + \frac {15 B a^{2} x \sin ^{4}{\left (c + d x \right )} \cos ^{4}{\left (c + d x \right )}}{32} + \frac {5 B a^{2} x \sin ^{2}{\left (c + d x \right )} \cos ^{6}{\left (c + d x \right )}}{16} + \frac {5 B a^{2} x \cos ^{8}{\left (c + d x \right )}}{64} + \frac {5 B a^{2} \sin ^{7}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{64 d} + \frac {55 B a^{2} \sin ^{5}{\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{192 d} + \frac {73 B a^{2} \sin ^{3}{\left (c + d x \right )} \cos ^{5}{\left (c + d x \right )}}{192 d} - \frac {B a^{2} \sin ^{2}{\left (c + d x \right )} \cos ^{7}{\left (c + d x \right )}}{7 d} - \frac {5 B a^{2} \sin {\left (c + d x \right )} \cos ^{7}{\left (c + d x \right )}}{64 d} - \frac {2 B a^{2} \cos ^{9}{\left (c + d x \right )}}{63 d} - \frac {B a^{2} \cos ^{7}{\left (c + d x \right )}}{7 d} & \text {for}\: d \neq 0 \\x \left (A + B \sin {\left (c \right )}\right ) \left (a \sin {\left (c \right )} + a\right )^{2} \cos ^{6}{\left (c \right )} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.55, size = 235, normalized size = 1.20 \begin {gather*} \frac {B a^{2} \cos \left (9 \, d x + 9 \, c\right )}{2304 \, d} - \frac {B a^{2} \sin \left (6 \, d x + 6 \, c\right )}{96 \, d} + \frac {5}{128} \, {\left (9 \, A a^{2} + 2 \, B a^{2}\right )} x - \frac {{\left (8 \, A a^{2} + B a^{2}\right )} \cos \left (7 \, d x + 7 \, c\right )}{1792 \, d} - \frac {{\left (2 \, A a^{2} + B a^{2}\right )} \cos \left (5 \, d x + 5 \, c\right )}{64 \, d} - \frac {{\left (18 \, A a^{2} + 11 \, B a^{2}\right )} \cos \left (3 \, d x + 3 \, c\right )}{192 \, d} - \frac {{\left (20 \, A a^{2} + 13 \, B a^{2}\right )} \cos \left (d x + c\right )}{128 \, d} - \frac {{\left (A a^{2} + 2 \, B a^{2}\right )} \sin \left (8 \, d x + 8 \, c\right )}{1024 \, d} + \frac {{\left (5 \, A a^{2} - 2 \, B a^{2}\right )} \sin \left (4 \, d x + 4 \, c\right )}{128 \, d} + \frac {{\left (8 \, A a^{2} + B a^{2}\right )} \sin \left (2 \, d x + 2 \, c\right )}{32 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 10.81, size = 622, normalized size = 3.17 \begin {gather*} \frac {5\,a^2\,\mathrm {atan}\left (\frac {5\,a^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (9\,A+2\,B\right )}{64\,\left (\frac {45\,A\,a^2}{64}+\frac {5\,B\,a^2}{32}\right )}\right )\,\left (9\,A+2\,B\right )}{64\,d}-\frac {5\,a^2\,\left (9\,A+2\,B\right )\,\left (\mathrm {atan}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )-\frac {d\,x}{2}\right )}{64\,d}-\frac {\frac {4\,A\,a^2}{7}-\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (\frac {83\,A\,a^2}{64}-\frac {5\,B\,a^2}{32}\right )+\frac {22\,B\,a^2}{63}+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{16}\,\left (4\,A\,a^2+2\,B\,a^2\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{14}\,\left (8\,A\,a^2+8\,B\,a^2\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (\frac {8\,A\,a^2}{7}+\frac {8\,B\,a^2}{7}\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8\,\left (32\,A\,a^2+4\,B\,a^2\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6\,\left (24\,A\,a^2+24\,B\,a^2\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{12}\,\left (24\,A\,a^2+\frac {16\,B\,a^2}{3}\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}\,\left (40\,A\,a^2+40\,B\,a^2\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (\frac {88\,A\,a^2}{7}+\frac {32\,B\,a^2}{7}\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{17}\,\left (\frac {83\,A\,a^2}{64}-\frac {5\,B\,a^2}{32}\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,\left (\frac {149\,A\,a^2}{32}-\frac {83\,B\,a^2}{16}\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{13}\,\left (\frac {149\,A\,a^2}{32}-\frac {83\,B\,a^2}{16}\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (\frac {189\,A\,a^2}{32}+\frac {191\,B\,a^2}{48}\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{15}\,\left (\frac {189\,A\,a^2}{32}+\frac {191\,B\,a^2}{48}\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7\,\left (\frac {409\,A\,a^2}{32}+\frac {145\,B\,a^2}{16}\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{11}\,\left (\frac {409\,A\,a^2}{32}+\frac {145\,B\,a^2}{16}\right )}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{18}+9\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{16}+36\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{14}+84\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{12}+126\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}+126\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8+84\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+36\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+9\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________